package com.epam.util;

import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class BundleReader {
	private static final Logger  LOGGER = LoggerFactory.getLogger(BundleReader.class);
	
    private static ResourceBundle bundle;
    public static final String BUNDLE_NAME = "fasebandle";
    
    public static String getProperty(String propertyName, Locale currentLocale) {
        if (currentLocale==null){
                currentLocale=new Locale("ru");
        }
        bundle = ResourceBundle.getBundle(BUNDLE_NAME,currentLocale);
        try {
                return bundle.getString(propertyName);
        } catch (MissingResourceException e) {
                LOGGER.warn(e.getMessage());
                return null;
        }

}


}
